﻿Imports System.Windows.Forms
Imports System.IO

Public Class DialogSetFolder

    Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click
        Dim pathNew = Path.Combine(TextBoxDir.Text, TextBoxFolder.Text)
        Dim newDir As New DirectoryInfo(pathNew)

        Dim ats = newDir.Attributes
        If Directory.Exists(pathNew) AndAlso ats = FileAttributes.Directory Then

            MsgBox("Aynı adla klasör mevcut", MsgBoxStyle.Exclamation Or MsgBoxStyle.OkOnly)

            Exit Sub
        End If
        Me.DialogResult = System.Windows.Forms.DialogResult.OK
        Me.Close()
    End Sub

    Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel_Button.Click
        Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
        Me.Close()
    End Sub

End Class
